package sshstudy.user.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import sshstudy.common.action.BaseAction;
import sshstudy.user.model.User;
import sshstudy.user.service.UserService;

@Component
public class UserViewAction extends BaseAction {
	
	private static final long serialVersionUID = 1L;
	
	private User user;
	
	@Autowired
	private UserService userService;
	
	@Override
	public String execute() {
		user = userService.find(user.getId());
		return SUCCESS;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
}
